* to the event widget. This option should only be used on containers that
* might possibly handle events before their children do.
* @GTK_PHASE_BUBBLE: Events are delivered in the bubble phase. The bubble
- * phase happens after the capture phase, runs from the event widget, up to
- * the toplevel.
+ * phase happens after the capture phase, and before the default handlers
+ * are run. This phase runs from the event widget, up to the toplevel.
+ * @GTK_PHASE_TARGET: Events are delivered in the default widget event handlers,
+ * note that widget implementations must chain up on button, motion, touch and
+ * grab broken handlers for controllers in this phase to be run.
*
* Describes the stage at which events are fed into a #GtkEventController.
*
{
GTK_PHASE_NONE,
GTK_PHASE_CAPTURE,
- GTK_PHASE_BUBBLE
+ GTK_PHASE_BUBBLE,
+ GTK_PHASE_TARGET
} GtkPropagationPhase;
/**
GtkWidget *widget;
g_return_if_fail (GTK_IS_GESTURE (gesture));
- g_return_if_fail (phase >= GTK_PHASE_NONE && phase <= GTK_PHASE_BUBBLE);
+ g_return_if_fail (phase >= GTK_PHASE_NONE && phase <= GTK_PHASE_TARGET);
widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (gesture));
_gtk_widget_add_controller (widget, GTK_EVENT_CONTROLLER (gesture), phase);
if (!grab_widget || grab_widget == widget)
return;
- if (((data->phase == GTK_PHASE_NONE ||
- data->phase == GTK_PHASE_BUBBLE) &&
+ if ((data->phase != GTK_PHASE_CAPTURE &&
!gtk_widget_is_ancestor (widget, grab_widget)) ||
(data->phase == GTK_PHASE_CAPTURE &&
!gtk_widget_is_ancestor (widget, grab_widget) &&
g_return_if_fail (GTK_IS_EVENT_CONTROLLER (controller));
g_return_if_fail (widget == gtk_event_controller_get_widget (controller));
g_return_if_fail (!_gtk_widget_has_controller (widget, controller));
- g_return_if_fail (phase >= GTK_PHASE_NONE && phase <= GTK_PHASE_BUBBLE);
+ g_return_if_fail (phase >= GTK_PHASE_NONE && phase <= GTK_PHASE_TARGET);
priv = widget->priv;
data = _gtk_widget_has_controller (widget, controller);